package com.kuangstudy.controller;

import com.kuangstudy.service.blacklist.BlackUserListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author renyitong
 * @version 1.0.0
 * @createTime 2023年09月18日
 * @Description
 */
@RestController
@Api(tags = "用户黑白名单业务")
public class BlackUserListController {

    @Autowired
    private BlackUserListService blackUserListService;


    @PostMapping("/add/user/black")
    @ApiOperation("将用户添加进黑名单")
    public Long addBlackList(Integer userid) {
        return blackUserListService.addBlackList(userid);
    }


    @PostMapping("/is/user/black")
    @ApiOperation("判断用户是否在黑名单中")
    public boolean isBlackList(Integer userid) {
        return blackUserListService.isBlackList(userid);
    }


    @PostMapping("/remove/user/black")
    @ApiOperation("将用户从黑名单中移除")
    public boolean removeBlackList(Integer userid) {
        return blackUserListService.removeBlackList(userid);
    }
}